home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / thinkref / archive / THINKPascalUH2.1.sea / THINKPas Univ Hdr 2.1 / Interfaces / MachineExceptions.p < prev    next >
Text File  |  1995-09-12  |  5KB  |  189 lines

  1. { Converted with MPW2TPas Tuesday, September 12, 1995 7:32:49 PM }
  2. {
  3.      File:        MachineExceptions.p
  4.  
  5.      Contains:    Processor Exception Handling Interfaces .
  6.  
  7.      Version:    Technology:    System 7.5
  8.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  9.  
  10.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  11.                  All rights reserved.
  12.  
  13.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  14.                  stack.  Include the file and version information (from above)
  15.                  in the problem description and send to:
  16.                      Internet:    apple.bugs@applelink.apple.com
  17.                      AppleLink:    APPLE.BUGS
  18.  
  19. }
  20.  
  21.  UNIT MachineExceptions;
  22.  INTERFACE
  23.  
  24.  
  25. {$IFC UNDEFINED __MACHINEEXCEPTIONS__}
  26. {$SETC __MACHINEEXCEPTIONS__ := 1}
  27.  
  28.   USES
  29.    ConditionalMacros, Types;
  30.  
  31. { $PUSH}
  32. { $ALIGN MAC68K}
  33. { $LibExport+}
  34.     
  35. TYPE
  36.     AreaID = KernelID;
  37.  
  38. { Machine Dependent types for PowerPC: }
  39.     MachineInformationPowerPC = RECORD
  40.         CTR:                    UnsignedWide;
  41.         LR:                        UnsignedWide;
  42.         PC:                        UnsignedWide;
  43.         CR:                        LONGINT;
  44.         XER:                    LONGINT;
  45.         MSR:                    LONGINT;
  46.     END;
  47.  
  48.     RegisterInformationPowerPC = RECORD
  49.         R0:                        UnsignedWide;
  50.         R1:                        UnsignedWide;
  51.         R2:                        UnsignedWide;
  52.         R3:                        UnsignedWide;
  53.         R4:                        UnsignedWide;
  54.         R5:                        UnsignedWide;
  55.         R6:                        UnsignedWide;
  56.         R7:                        UnsignedWide;
  57.         R8:                        UnsignedWide;
  58.         R9:                        UnsignedWide;
  59.         R10:                    UnsignedWide;
  60.         R11:                    UnsignedWide;
  61.         R12:                    UnsignedWide;
  62.         R13:                    UnsignedWide;
  63.         R14:                    UnsignedWide;
  64.         R15:                    UnsignedWide;
  65.         R16:                    UnsignedWide;
  66.         R17:                    UnsignedWide;
  67.         R18:                    UnsignedWide;
  68.         R19:                    UnsignedWide;
  69.         R20:                    UnsignedWide;
  70.         R21:                    UnsignedWide;
  71.         R22:                    UnsignedWide;
  72.         R23:                    UnsignedWide;
  73.         R24:                    UnsignedWide;
  74.         R25:                    UnsignedWide;
  75.         R26:                    UnsignedWide;
  76.         R27:                    UnsignedWide;
  77.         R28:                    UnsignedWide;
  78.         R29:                    UnsignedWide;
  79.         R30:                    UnsignedWide;
  80.         R31:                    UnsignedWide;
  81.     END;
  82.  
  83.     FPUInformationPowerPC = RECORD
  84.         Registers:                ARRAY [0..31] OF UnsignedWide;
  85.         FPSCR:                    LONGINT;
  86.         Reserved:                LONGINT;
  87.     END;
  88.  
  89.  
  90. CONST
  91.     kWriteReference                = 0;
  92.     kReadReference                = 1;
  93.     kFetchReference                = 2;
  94.     writeReference                = kWriteReference;                { Obsolete name}
  95.     readReference                = kReadReference;                { Obsolete name}
  96.     fetchReference                = kFetchReference;                { Obsolete name}
  97.  
  98.     
  99. TYPE
  100.     MemoryReferenceKind = LONGINT;
  101.  
  102.     MemoryExceptionInformation = RECORD
  103.         theArea:                AreaID;
  104.         theAddress:                LogicalAddress;
  105.         theError:                OSStatus;
  106.         theReference:            MemoryReferenceKind;
  107.     END;
  108.  
  109.  
  110. CONST
  111.     kUnknownException            = 0;
  112.     kIllegalInstructionException = 1;
  113.     kTrapException                = 2;
  114.     kAccessException            = 3;
  115.     kUnmappedMemoryException    = 4;
  116.     kExcludedMemoryException    = 5;
  117.     kReadOnlyMemoryException    = 6;
  118.     kUnresolvablePageFaultException = 7;
  119.     kPrivilegeViolationException = 8;
  120.     kTraceException                = 9;
  121.     kInstructionBreakpointException = 10;
  122.     kDataBreakpointException    = 11;
  123.     kIntegerException            = 12;
  124.     kFloatingPointException        = 13;
  125.     kStackOverflowException        = 14;
  126.     kTerminationException        = 15;
  127.     unknownException            = kUnknownException;            { Obsolete name}
  128.     illegalInstructionException    = kIllegalInstructionException;    { Obsolete name}
  129.     trapException                = kTrapException;                { Obsolete name}
  130.     accessException                = kAccessException;                { Obsolete name}
  131.     unmappedMemoryException        = kUnmappedMemoryException;        { Obsolete name}
  132.     excludedMemoryException        = kExcludedMemoryException;        { Obsolete name}
  133.     readOnlyMemoryException        = kReadOnlyMemoryException;        { Obsolete name}
  134.     unresolvablePageFaultException = kUnresolvablePageFaultException; { Obsolete name}
  135.     privilegeViolationException    = kPrivilegeViolationException;    { Obsolete name}
  136.     traceException                = kTraceException;                { Obsolete name}
  137.     instructionBreakpointException = kInstructionBreakpointException; { Obsolete name}
  138.     dataBreakpointException        = kDataBreakpointException;        { Obsolete name}
  139.     integerException            = kIntegerException;            { Obsolete name}
  140.     floatingPointException        = kFloatingPointException;        { Obsolete name}
  141.     stackOverflowException        = kStackOverflowException;        { Obsolete name}
  142.     terminationException        = kTerminationException;        { Obsolete name}
  143.  
  144.     
  145. TYPE
  146.     ExceptionKind = LONGINT;
  147.  
  148.     ExceptionInfo = RECORD
  149.         CASE INTEGER OF
  150.         0: (
  151.             memoryInfo:                    ^MemoryExceptionInformation;
  152.            );
  153.     END;
  154.  
  155.     ExceptionInformationPowerPC = RECORD
  156.         theKind:                ExceptionKind;
  157.         machineState:            ^MachineInformationPowerPC;
  158.         registerImage:            ^RegisterInformationPowerPC;
  159.         FPUImage:                ^FPUInformationPowerPC;
  160.         info:                    ExceptionInfo;
  161.     END;
  162.  
  163. {$IFC GENERATINGPOWERPC }
  164.     ExceptionInformation = ExceptionInformationPowerPC;
  165.  
  166.     MachineInformation = MachineInformationPowerPC;
  167.  
  168.     RegisterInformation = RegisterInformationPowerPC;
  169.  
  170.     FPUInformation = FPUInformationPowerPC;
  171.  
  172. {$ENDC}
  173. { Note:    An ExceptionHandler is NOT a UniversalProcPtr.
  174.             It must be a native function pointer with NO routine descriptor. }
  175.     ExceptionHandler = ProcPtr;  { FUNCTION (VAR theException: ExceptionInformationPowerPC): OSStatus; }
  176.  
  177. { Routine for installing per-process exception handlers }
  178.  
  179. FUNCTION InstallExceptionHandler(theHandler: ExceptionHandler): ExceptionHandler;
  180.  
  181. { $ALIGN RESET}
  182. { $POP}
  183.  
  184. {$ENDC} {__MACHINEEXCEPTIONS__}
  185.  
  186.  IMPLEMENTATION
  187.  END.
  188.  
  189.